import 'dart:async';

class CounterBloC {
  int _counter = 0;

  final _counterStreamController = StreamController<int>();

  Stream<int> get streamCounter => _counterStreamController.stream;

  void addCount() {
    _counterStreamController.sink.add(++_counter);
  }

  void dispose() {
    _counterStreamController.close();
  }
}
